package io.renren.modules.generator.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import io.renren.modules.generator.dao.SchoolDao;
import io.renren.modules.generator.entity.SchoolEntity;
import io.renren.modules.generator.service.SchoolService;
import io.renren.util.UUIDUtil;



@Service("schoolService")
public class SchoolServiceImpl implements SchoolService {
	@Autowired
	private SchoolDao schoolDao;
	
	@Override
	public SchoolEntity queryObject(String schoolno){
		return schoolDao.queryObject(schoolno);
	}
	
	@Override
	public List<SchoolEntity> queryList(Map<String, Object> map){
		return schoolDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return schoolDao.queryTotal(map);
	}
	
	@Override
	public void save(SchoolEntity school){
		school.setSchoolno(UUIDUtil.getOrderIdByUUId());
		school.setModifydate(new Date());
		schoolDao.save(school);
	}
	
	@Override
	public void update(SchoolEntity school){
		schoolDao.update(school);
	}
	
	@Override
	public void delete(String schoolno){
		schoolDao.delete(schoolno);
	}
	
	@Override
	public void deleteBatch(String[] schoolnos){
		schoolDao.deleteBatch(schoolnos);
	}

	@Override
	public List<SchoolEntity> findAllSchool() {
		return schoolDao.findAllSchool();
	}

	@Override
	public List<SchoolEntity> findAllCampus(String schoolName) {
		return schoolDao.findAllCampus(schoolName);
	}
	
}
